<template>
  <div id="lineChange">
    <el-collapse v-model="open">
      <el-collapse-item title="内容" name="1">
        <ul class="content-list">
          <li>
            <span>线条样式：</span>
            <div>
              <el-button-group>
                <el-button size="mini" @click="styles.type=1" type plain>
                  <svg style="font-size:16px" class="icon" aria-hidden="true">
                    <use xlink:href="#iconjian-cuxiantiao" />
                  </svg>
                </el-button>
                <el-button size="mini" @click="styles.type=2" type plain>
                  <svg style="font-size:16px" class="icon" aria-hidden="true">
                    <use xlink:href="#iconfengexiantiao" />
                  </svg>
                </el-button>
                <el-button size="mini" @click="styles.type=3" type plain>
                  <svg style="font-size:16px" class="icon" aria-hidden="true">
                    <use xlink:href="#iconxuxian" />
                  </svg>
                </el-button>
                <el-button size="mini" @click="styles.type=4" type plain>
                  <svg style="font-size:16px" class="icon" aria-hidden="true">
                    <use xlink:href="#icon-xiaoxuxian" />
                  </svg>
                </el-button>
              </el-button-group>
            </div>
          </li>
        </ul>
      </el-collapse-item>
    </el-collapse>
    <el-collapse v-model="open2">
      <el-collapse-item title="内容样式" name="2">
        <ul class="content-list">
          <li>
            <span>线条颜色：</span>
            <div>
              <colorSetting v-model="styles.colorBg" :originColor="styles.colorBg" initColor="#c2c2c2"></colorSetting>
            </div>
          </li>
          <li>
            <span>上下间距：</span>
            <div>
              <edgeSetting v-model="styles.marginTB" unit="px" :max="100" :init="Number(styles.marginTB)"></edgeSetting>
            </div>
          </li>
          <li>
            <span>元素高度：</span>
            <div>
              <edgeSetting v-model="styles.height" unit="px" :max="50" :init="Number(styles.height)"></edgeSetting>
            </div>
          </li>
        </ul>
      </el-collapse-item>
    </el-collapse>
  </div>
</template>

<script>
import { mapState, mapMutations } from "vuex";
import edgeSetting from "../../comm/edgeSetting";
import colorSetting from "../../comm/colorSetting";
export default {
  name: "lineChange",
  data() {
    return {
      open: "1",
      open2: "2",
    };
  },
  computed: {
    ...mapState(["list", "currentId", "currentName"]),
    styles() {
      return this.list[this.currentId].styles;
    },
  },
  components: {
    edgeSetting,
    colorSetting
  },
};
</script>

<style lang="less" scoped>
@import url("../../../assets/css/base.less");
</style>
